/*
 * TableElement.cpp
 *
 *  Created on: 2010-6-7
 *      Author: guobc
 */

#include "TableElement.h"
#include "TableRowElement.h"

using namespace HA;

string TableElement::mIds[] = {"TABLE", ""};
string TableElement::mEnds[] = {"TABLE", "BODY", "HTML", ""};

TableElement::TableElement() :
	HA::CommonElement() {

}

ASTNodeList TableElement::getTableRows() {
	ASTNodeList children = getChildren();
	ASTNode* node;
	TableRowElement* row;
	ASTNodeList rows;
	int size = children.size();
	for (int i = 0; i < size; i++) {
		node = children.item(i);
		row = dynamic_cast<TableRowElement*> (node);
		if (row != NULL) {
			rows.append(row);
		}
	}

	return rows;
}
